<?php
$this->pageTitle=Yii::app()->name . ' - Meteorogramy';
$this->breadcrumbs=array(
	'Meteorogramy',
);
?>

<script
	type="text/javascript"
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script
	type="text/javascript"
	src="<?php echo Yii::app()->request->baseUrl; ?>/js/js/highcharts.js"></script>
<script
	type="text/javascript"
	src="<?php echo Yii::app()->request->baseUrl; ?>/js/chartsThemeGray.js"></script>
<script
	type="text/javascript"
	src="<?php echo Yii::app()->request->baseUrl; ?>/js/locations.js"></script>
<script
	type="text/javascript"
	src="<?php echo Yii::app()->request->baseUrl; ?>/js/charts.js"></script>
<script
	type="text/javascript"
	src="<?php echo Yii::app()->request->baseUrl; ?>/js/chartsSep.js"></script>
	
<body onload="calcChartsData(1,'Gdańsk');">
	<div id="chartHeader" style="width: 900px; text-align: center;"></div>
	<div id="chartTemp" style="width: 900px;"></div>
	<div id="chartRain" style="width: 900px;"></div>
	<div id="chartWind" style="width: 900px;"></div>
	<div id="chartCloud" style="width: 900px;"></div>
</body>
<?php $this->beginWidget('system.web.widgets.CClipWidget', array('id'=>'sidebar')); ?>
 <div class="panel">
<div class="panel_top">Rejony</div>
<div id="panel_content_locations" class="panel_content">
<script>
$.ajax({
		type : 'POST',
		dataType : 'json',
		data : {
		},
		url : 'index.php?r=data/getAllLocations',
		success : function(data) {
			document.getElementById('panel_content_locations').innerHTML+='<ul>';
			for(i=0; i<data.length; i++){
				title=data[i]['title'];
				id=data[i]['id'];
				document.getElementById('panel_content_locations').innerHTML+='<li><a href="#" onclick="calcChartsData('+id+', \''+title+'\')">'+title+'</a></li>';
			}
			document.getElementById('panel_content_locations').innerHTML+='</ul>';
		},
		error : function(data, textStatus, jqXHR) {
			alert('294');
		},
		dataType : 'json'
	});
</script>
</div>
</div>

<?php $this->endWidget();?>